<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <title>登录 小熊猫金服</title>
    <link href="{{asset('css/style.css')}}" rel="stylesheet" type="text/css" />
    <link href="{{asset('/css/login.css')}}" rel="stylesheet" type="text/css" />
    <script src="{{asset('/js/jquery-1.7.1.min.js')}}" type="text/javascript"></script>
    <script src="{{asset('/js/js.js')}}" type="text/javascript"></script>
</head>
<body>
<!--header start-->
<div class="header_reg">
    <div class="logo"><a href="/"><img src="{{asset('images/logo_reg.png')}}"/></a></div>
</div>
<!--header end-->

<!--main start-->
<form action="{{url('wechat/register')}}" method="post">
    {{csrf_field()}}
    <div class="reg_box_w">
        <div class="reg_box">
            @if(session('msg'))
                <p style="text-align: center; color: red; font-size: 18px;">{{session('msg')}}</p>
            @endif
            <div>
                @if(count($errors)>0)
                    @foreach($errors->all() as $error)
                        <p style="text-align: center; color: red; font-size: 18px;">{{$error}}</p>
                    @endforeach
                @endif
            </div>
            <div class="tit">免费注册账户</div>
            <div class="reg_form">
                <div class="i1_w" ><input class="input" name="name" type="text" value="{{old('name')}}"   placeholder="必填项：请输入用户名"/>

                </div>

                <div class="i2_w"><input class="input" name="password" type="password"  value="{{old('password')}}"  placeholder="请输入密码" />
                </div>

                <div class="i2_w"><input class="input" name="password_confirmation" type="password"  value="{{old('password_confirmation')}}"  placeholder="请再次输入密码" />
                </div>

                <div class="i2_w"><input class="input" id="mobile" name="mobile" type="text"  value="{{old('mobile')}}" placeholder="必填项：请输入手机号码" onkeyup='this.value=this.value.replace(/\D/gi,"")'/>
                </div>

                {{--<div class="line">--}}
                {{--<div class="btn_hq" ><img src="{{asset('images/yzm.gif')}}" width="115" height="45" /></div>--}}
                {{--<div class="i3_w"><input class="input_3" name="" type="text" value="验证码" onblur="if (this.value =='') {this.value='验证码';}" onfocus="if(value=='验证码'){value='';}" />--}}
                {{--</div>--}}

                {{--<div class="clear"></div>--}}
                {{--</div>--}}

                <div class="line">
                    <div class="btn_qr"  type="button">获取验证码</div>
                    <div class="i3_w"><input class="input_3" name="validateCode" type="" value="{{old('validateCode')}}"  placeholder="请输入手机验证码" />
                    </div>

                    <div class="clear"></div>
                </div>
                <div class="i2_w">
                    <input id="idNo" name="idNo"   class="input" type="text"   value="{{old('idNo')}}"  placeholder="必填项：请输入身份证号码" />
                </div>

                <div class="about">
                    <div class="zd">
                        <input id="agree" name="agree" type="checkbox" @if(old('agree') == 'on') checked="checked" @endif/>
                        <label for="agree">我已经阅读并同意 <a href="{{url('/agreement')}}">《小熊猫金服注册及服务协议》</a></label>
                    </div>
                </div>
                <input type="hidden" name="useragent" value="wechat"/>
                <div class="btn_w"><input class="btn"  id="zhuce" type="submit" value="立即注册" />
                </div>
                <div class="txt">已有帐号？ <a href="{{url('wechat/login')}}">登录</a></div>
            </div>
        </div>
    </div>
</form>
<!--main end-->

<!--footer start-->
<!--footer end-->
<script type="text/javascript" language="JavaScript">


    $(function(){
        //发送验证码
        $(".btn_qr").on('click' , function(){
            if($("#mobile").val() == ''){
                alert("请输入手机号");
                return;
            }
            $.ajax({
                type: "POST",
                url: "{{url('user/validatecode')}}",
                data: {'mobile':$("#mobile").val(), '_token': '{{csrf_token()}}' }
            }).always(function(data){
                alert(data.content);
            });
        });

        //
    });
</script>

</body>
</html>